import http from '@/utils/request'

/**
 * 获取商品列表数据
 * @module apis/product
 */
export function fetchList(data: object) {
  return http.get('/api/product/list', data)
}
/**
 * 获取主键数据
 */
export function fetchById(id: string) {
  return http.get('/api/product/' + id)
}
/**
 * 新增商品列表数据
 */
export function create(data: object) {
  return http.post('/api/product', data)
}

/**
 * 修改数据
 */
export function update(data: object) {
  return http.put('/api/product', data)
}
/**
 * 移除数据
 */
export function remove(id: string) {
  return http.delete('/api/product/' + id)
}

export default {
  fetchList,
  create,
  remove,
  fetchById,
  update
}
